package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.service.IStrategyCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*
* 大攻略评论
*
* */
@RestController
@RequestMapping("strategyComments")
public class StrategyCommentController {

    @Autowired
    private IStrategyCommentService commentService;

    /**
     * 根据用户id查询他的所有大攻略评论
     */
    @GetMapping("user/{id}")
    public List<StrategyComment> getById(@PathVariable Long id){
        return commentService.listByUserId(id);
    }

}
